﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DMHelper.Models;

namespace DMHelper.Models
{
    public class EquipmentContainer
    {
        public NumericalField lightWeight = new NumericalField();
        public NumericalField mediumWeight = new NumericalField();
        public NumericalField heavyWeight = new NumericalField();

        public AdditionNumericalField totalWeight = new AdditionNumericalField();

        public List<ItemContainer> items = new List<ItemContainer>();
        public void AddItem(ItemContainer i)
        {
            totalWeight.listeModifier.Add(i.Weight);
            items.Add(i);
        }

        public ItemContainer item(int position)
        {
            return items[position];
        }

        private StringField _weightStatus = new StringField();
        public StringField WeightStatus
        {
            get
            {
                if (totalWeight.Value < lightWeight.Value)
                {
                    _weightStatus.Value = "Light";
                }
                else if(totalWeight.Value < mediumWeight.Value)
                {
                    _weightStatus.Value = "Medium";
                }
                else if(totalWeight.Value < heavyWeight.Value)
                {
                    _weightStatus.Value = "Heavy";
                }
                else
                {
                    _weightStatus.Value = "Over-Encumbered";
                }
                return _weightStatus;
            }
        }
    }
}